package com.xingkeduo.pojo.table;

import com.xingkeduo.util.pojo.base.BaseEnum;
import com.xingkeduo.util.pojo.base.BaseTable;
import org.apache.ibatis.type.Alias;

import java.util.Date;
import java.util.List;

/**
 * 求职者审核信息类
 * 
 * @author 高杰
 * @time 2018年12月26日 上午11:37:13
 * @description
 */
@Alias("JobseekerAssess")
public class JobseekerAssessTO extends BaseTable<JobseekerAssessTO> {
	public enum Type implements BaseEnum {
		TEST1(30, "初试"),
		TEST2(40, "复试"),
		TEST3(50, "毕业考核");

		private int value;
		private String desc;

		private Type(int value, String desc) {
			this.value = value;
			this.desc = desc;
		}

		public static boolean validValue(String value) {
			int value_int = Integer.parseInt(value);
			return validValue(value_int);
		}

		public static boolean validValue(int value) {
			Type[] types = Type.values();
			for (int i = 0; i < types.length; i++) {
				if (types[i].getValue() == value)
					return true;
			}
			return false;
		}

		public static Type getType(String value) {
			int value_int = Integer.parseInt(value);
			return getType(value_int);
		}


		public static Type getType(int value) {
			switch (value) {
			case 30:
				return TEST1;
			case 40:
				return TEST2;
			case 50:
				return TEST3;
			default:
				return null;
			}
		}

		@Override
		public int getValue() {
			return value;
		}

		public String getDesc() {
			return desc;
		}
	}

	public enum Result implements BaseEnum {
		PASS(10, "通过"), RESERVE(20, "储备"), ELIMINATE(30, "淘汰");

		private int value;
		private String desc;

		private Result(int value, String desc) {
			this.value = value;
			this.desc = desc;
		}

		public static boolean validValue(String value) {
			int value_int = Integer.parseInt(value);
			return validValue(value_int);
		}

		public static boolean validValue(int value) {
			Result[] results = Result.values();
			for (int i = 0; i < results.length; i++) {
				if (results[i].getValue() == value)
					return true;
			}
			return false;
		}

		public static Result getResult(String value) {
			int value_int = Integer.parseInt(value);
			return getResult(value_int);
		}

		public static Result getResult(int value) {
			switch (value) {
			case 10:
				return PASS;
			case 20:
				return RESERVE;
			case 30:
				return ELIMINATE;
			default:
				return null;
			}
		}

		@Override
		public int getValue() {
			return value;
		}

		public String getDesc() {
			return desc;
		}
	}

	private String login;
	private Type type;
	private Result result;
	private Date enterTime;
	private String comments;
	private List<JobseekerAssessRateTO> rates;

	public String getLogin() {
		return login;
	}

	public JobseekerAssessTO setLogin(String login) {
		this.login = login;
		return this;
	}

	public Type getType() {
		return type;
	}

	public JobseekerAssessTO setType(Type type) {
		this.type = type;
		return this;
	}

	public Result getResult() {
		return result;
	}

	public JobseekerAssessTO setResult(Result result) {
		this.result = result;
		return this;
	}

	public Date getEnterTime() {
		return enterTime;
	}

	public JobseekerAssessTO setEnterTime(Date enterTime) {
		this.enterTime = enterTime;
		return this;
	}

	public String getComments() {
		return comments;
	}

	public JobseekerAssessTO setComments(String comments) {
		this.comments = comments;
		return this;
	}

	public List<JobseekerAssessRateTO> getRates() {
		return rates;
	}

	public JobseekerAssessTO setRates(List<JobseekerAssessRateTO> rates) {
		this.rates = rates;
		return this;
	}
}
